package com.videoaggre.zcl.ui.adapter

import android.view.View
import android.view.ViewGroup
import com.videoaggre.zcl.bean.EnterdeskClassify
import com.videoaggre.zcl.databinding.AgefansItemCatalogValueBinding
import com.videoaggre.zcl.ui.widget.CommonButton

class EnterdeskTagAdapter : BaseSignCheckAdapter<BaseViewHolder<AgefansItemCatalogValueBinding>, EnterdeskClassify>() {
    override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = BaseViewHolder(AgefansItemCatalogValueBinding.inflate(getLayoutInflate(parent.context), parent, false))
    override fun onBindViewHolder(holder: BaseViewHolder<AgefansItemCatalogValueBinding>, bean: EnterdeskClassify, position: Int) {
        holder.mViewBinding.run {
            bean.run {
                cbCatalogValue.text = name
                cbCatalogValue.changeStyle(if (check) CommonButton.CB_STROKE_NORMAL else CommonButton.CB_STROKE_TEXT)
                setViewClick(position, root)
            }
        }
    }

    override fun subOnClickAdapter(v: View, position: Int) {
        super.subOnClickAdapter(v, position)
        //rvCatalogValue.layoutManager?.smoothScrollToPosition(rvCatalog, RecyclerView.State(), position)
        //onRefresh(null)
    }
}